package com.example.springretrydemo;

import com.example.springretrydemo.service.TestRetryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.retry.annotation.EnableRetry;

@EnableRetry
@SpringBootApplication
public class SpringRetryDemoApplication implements CommandLineRunner {

    @Autowired
    private TestRetryService testRetryService;

    public static void main(String[] args) {
        SpringApplication.run(SpringRetryDemoApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println(testRetryService.test(0));
    }
}
